//
//  Conclusion ViewController.swift
//  SidebarMenu
//
//  Created by LiangXiaobin on 2017/2/3.
//  Copyright © 2017年 AppCoda. All rights reserved.
//

import UIKit

class ConclusionViewController: BaseViewController {

    var baseScorollView:UIScrollView?
    var headView:UIImageView?
    var firstView:ConclusionView?
    var secondView:ConclusionView?
    var thirdView:ConclusionView?
    var forthView:ConclusionView?
    var fifthView:ConclusionView?
    var sixthView:ConclusionView?
    /*
     心率分布图
     */
    var hrpView:ImportConclusionView?
    /*
     心率变异性
     */
    var hrvView:ImportConclusionView?
    /*
     散点图
     */
    var asdView:ImportConclusionView?
    
    /*TRR_I*/
    var trrLView:ImportConclusionView?
    
    var alarmView:ConclusionCollectionView?
    var input:InputView?
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        self.topTittle?.text = "填写结论"
        self.rightBtn?.isHidden = false
        self.rightBtn?.setTitle("波形回放", for: UIControlState.normal)
        
        baseScorollView = UIScrollView(frame:CGRect(x:0,y:64,width:screenWidth,height:screenHeight - 64))
        baseScorollView?.backgroundColor = UIColor.white
        self.view.addSubview(baseScorollView!)
        
        
        
        headView = UIImageView(frame:CGRect(x:20,y:20,width:60,height:60))
        headView?.layer.cornerRadius = 30
        headView?.clipsToBounds = true
        baseScorollView?.addSubview(headView!)
        
        
        let vline = UIView(frame:CGRect(x:Int(screenWidth - 105 - 2),y:0,width:2,height:85))
        vline.backgroundColor = baseColor
        baseScorollView?.addSubview(vline)
        
        let sline = UIView(frame:CGRect(x:0,y:85,width:screenWidth,height:1))
        sline.backgroundColor = baseColor
        sline.alpha = 0.5
        baseScorollView?.addSubview(sline)
        
        
        firstView = ConclusionView(frame:CGRect(x:5,y:85 + 1 + 5,width:(screenWidth - 20) / 3,height:105))
        firstView?.layer.borderWidth = 1
        firstView?.layer.borderColor = grayColor.cgColor
        baseScorollView?.addSubview(firstView!)
        
        secondView = ConclusionView(frame:CGRect(x:5 + 5 + (screenWidth - 20) / 3,y:85 + 1 + 5,width:(screenWidth - 20) / 3,height:105))
        secondView?.layer.borderWidth = 1
        secondView?.layer.borderColor = grayColor.cgColor
        baseScorollView?.addSubview(secondView!)
        
        thirdView = ConclusionView(frame:CGRect(x:5 + 5 + 5 + (screenWidth - 20) / 3 + (screenWidth - 20) / 3,y:85 + 1 + 5,width:(screenWidth - 20) / 3,height:105))
        thirdView?.layer.borderWidth = 1
        thirdView?.layer.borderColor = grayColor.cgColor
        baseScorollView?.addSubview(thirdView!)
        
        forthView = ConclusionView(frame:CGRect(x:5,y:85 + 1 + 5 + 105 + 5,width:(screenWidth - 20) / 3,height:105))
        forthView?.layer.borderWidth = 1
        forthView?.layer.borderColor = grayColor.cgColor
        baseScorollView?.addSubview(forthView!)
        
        fifthView = ConclusionView(frame:CGRect(x:5 + 5 + (screenWidth - 20) / 3,y:85 + 1 + 5 + 105 + 5,width:(screenWidth - 20) / 3,height:105))
        fifthView?.layer.borderWidth = 1
        fifthView?.layer.borderColor = grayColor.cgColor
        baseScorollView?.addSubview(fifthView!)
        
        sixthView = ConclusionView(frame:CGRect(x:5 + 5 + 5 + (screenWidth - 20) / 3 + (screenWidth - 20) / 3,y:85 + 1 + 5 + 105 + 5,width:(screenWidth - 20) / 3,height:105))
        sixthView?.layer.borderWidth = 1
        sixthView?.layer.borderColor = grayColor.cgColor
        baseScorollView?.addSubview(sixthView!)
        
        
        hrpView = ImportConclusionView(frame:CGRect(x:5,y:85 + 1 + 5 + 105 + 5 + 105 + 10,width:(screenWidth - 10 - 24) / 2,height:210))
        baseScorollView?.addSubview(hrpView!)
        
        hrvView = ImportConclusionView(frame:CGRect(x:5 + 12 + (screenWidth - 10 - 24) / 2 ,y:85 + 1 + 5 + 105 + 5 + 105 + 10,width:(screenWidth - 10 - 24) / 2,height:210))
        baseScorollView?.addSubview(hrvView!)
        
        asdView = ImportConclusionView(frame:CGRect(x:5,y:85 + 1 + 5 + 105 + 5 + 105 + 10 + 210 + 10,width:screenWidth - 10,height:420))
        baseScorollView?.addSubview(asdView!)
        
        
        trrLView = ImportConclusionView(frame:CGRect(x:5,y:85 + 1 + 5 + 105 + 5 + 105 + 10 + 210 + 10 + 420 + 10,width:screenWidth - 10,height:260))
        baseScorollView?.addSubview(trrLView!)
        
        alarmView = ConclusionCollectionView(frame:CGRect(x:0,y:85 + 1 + 5 + 105 + 5 + 105 + 10 + 210 + 10 + 420 + 10 + 260 + 10,width:screenWidth,height:235))
        baseScorollView?.addSubview(alarmView!)
        
        
        input = InputView(frame:CGRect(x:0,y:85 + 1 + 5 + 105 + 5 + 105 + 10 + 210 + 10 + 420 + 10 + 260 + 10 + 235 + 10,width:screenWidth,height:190))
        baseScorollView?.addSubview(input!)
    
        baseScorollView?.contentSize = CGSize(width:screenWidth,height:85 + 1 + 5 + 105 + 5 + 105 + 10 + 210 + 10 + 420 + 10 + 260 + 10 + 235 + 10 + 190)
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
